package com.demo.seckill.queue.kafka;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * @author libo
 * @ClassName KafkaSender
 * @Description: kafka发送消息
 * @date 2018/11/29 18:21
 */
@Component
public class KafkaSender {

    @Autowired
    private KafkaTemplate<String ,String> kafkaTemplate;

    //发送消息到kafka
    public void sendChannelMessage(String channel,String message){
            kafkaTemplate.send(channel,message);
    }

}
